<template>
    <div class="suspend">
        <div class="img-con mb5"   @click="saveAllInfo">
            <el-tooltip class="item fixd_botton_dark" effect="dark" content="保存" placement="left">
                <span class="fixd_botton"><img :src="saveImg" alt="保存"> </span>
            </el-tooltip>
        </div>

        <div class="img-con mb5"  title="提交核决" @click="subNucleusDecide">
            <el-tooltip class="item fixd_botton_dark" effect="dark" content="提交核决" placement="left">
                <span class="fixd_botton"><img :src="uwokImg" alt="提交核决"> </span>
            </el-tooltip>
        </div>

        <div class="img-con mb5"  @click="backToUw" title="退回续核">
            <el-tooltip class="item fixd_botton_dark" effect="dark" content="退回续核" placement="left">
                <span class="fixd_botton"><img :src="backToUwImg" alt="退回续核"> </span>
            </el-tooltip>
        </div>

        <div class="img-con"  @click="back">
            <el-tooltip class="item fixd_botton_dark" effect="dark" content="状态回退" placement="left">
                <span class="fixd_botton"><img :src="goBackImg" alt="状态回退"> </span>
            </el-tooltip>
        </div>

    </div>
</template>
<script>
  import saveImg from '@/assets/img/botton/preserve.png';  //保存图标
  // import filingImg from '@/assets/img/botton/preserve.png';
  import goBackImg from '@/assets/img/botton/goback.png';   //返回图标
  import backToUwImg from '@/assets/img/botton/backToUw.png';  //退回续核
  import uwokImg from '@/assets/img/botton/uwok.png';  //提交核决

  export default {
    data() {
      return {
        saveImg: saveImg,
        // filingImg: filingImg,
        backToUwImg: backToUwImg,
        uwokImg: uwokImg,
        goBackImg: goBackImg
      }
    },
    props: {
      loacFlag: {
        type: Boolean,
        default: false
      },
      btnDisable: {
        type: Boolean,
        default: false
      }
    },
    methods: {
      saveAllInfo() {
        if(!this.btnDisable && !this.loacFlag){
          this.$emit('doSave');
        }else{
          this.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，任务节点为照会待回复，或者任务已被流转，不可进行此操作", "error")
        }
      },
      subNucleusDecide() {
        if(!this.btnDisable && !this.loacFlag){
          this.$emit('subNucleusDecide');
        }else{
          this.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，任务节点为照会待回复，或者任务已被流转，不可进行此操作", "error")
        }
      },
      back() {
        if(!this.btnDisable && !this.loacFlag){
          this.$emit('back');
        }else{
          this.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，任务节点为照会待回复，或者任务已被流转，不可进行此操作", "error")
        }
      },
      backToUw() {
        if(!this.btnDisable && !this.loacFlag){
          this.$emit('backToUw');
        }else{
          this.alertMsg("案件状态为：7-送其他部门处理、9-结案、A-撤回、B-结案失败，任务节点为照会待回复，或者任务已被流转，不可进行此操作", "error")
        }
      },
      alertMsg(message, type) {
        this.$message({
          message: message,
          type: type
        });
      },
    }
  }
</script>
<style lang="less" scoped>
    .suspend {
        position: fixed;
        top: 36.5%;
        right: 25px;
        z-index: 10000;

        .img-con {
            width: 40px;
            height: 36px;
            background: rgba(0, 0, 0, 0.4);
            text-align: center;
            line-height: 36px;
            border-radius: 4px;
            cursor: pointer;

            img {
                vertical-align: middle;
                width: 24px;
            }
        }
    }
</style>